package com.msb.common.utils;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * time:2025/1/16 11:24
 * author:Administrator
 * desc:msb-mall-HutoolTest
 */
public class HutoolTest {

    public static void main(String[] args) {


        System.out.println("123-456-789".substring("123-456-789".lastIndexOf("-")+1));
        System.out.println("123-456-789".substring("123-456-789".lastIndexOf("-"),"123-456-789".length()-1));


        List<DraftDirectoryNode> list = new ArrayList<>();

        Collections.sort(list, (node1, node2) ->{
            if(node1.getDraftNodeId()-node2.getDraftNodeId() > 0L){
                return 1;
            }
            if(node1.getDraftNodeId()-node2.getDraftNodeId() < 0L){
                return -1;
            }
           return 0;
        });

        Collections.sort(list, new Comparator<DraftDirectoryNode>() {
            @Override
            public int compare(DraftDirectoryNode o1, DraftDirectoryNode o2) {
                return 0;
            }
        });

        list.sort((Comparator<? super DraftDirectoryNode>) list);

    }


}
